/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package aptech.semester.code.common;

import java.io.File;
import javax.swing.filechooser.FileFilter;


/**
 *
 * @author vi
 */
public class ImageFileFilter extends FileFilter{

    @Override
    public boolean accept(File pathname) {
        return pathname.isDirectory() 
                || pathname.getAbsolutePath().endsWith(".png")
                || pathname.getAbsolutePath().endsWith(".jpeg")
                || pathname.getAbsolutePath().endsWith(".jpg")
                || pathname.getAbsolutePath().endsWith(".gif")
                 || pathname.getAbsolutePath().endsWith(".PNG");
    }

    @Override
    public String getDescription() {
        return "Image file only (.png, .jpg, .jpeg, .gif, .PNG)";
    }
    
}
